<?php

namespace Beike\Seller\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class RegisterRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'email'      => 'required|email:rfc|unique:seller_users,email',
            'store_name' => 'required|unique:sellers,store_name',
            'password'   => 'required',
            'type'   => 'required',
            'id_card'   => 'required',
            'id_number'   => 'required',
            'agree'      => 'required|accepted',
        ];
    }

    public function attributes()
    {
        return [
            'email'      => trans('seller::login.email'),
            'password'   => trans('seller::login.password'),
            'store_name' => trans('seller::login.store_name'),
            'agree'      => trans('seller::register.agree'),
            'type'   => trans('seller::register.seller_type'),
            'id_card'   => trans('seller::register.id_card_photo') . '/' . trans('seller::register.business_license'),
            'id_number'   => trans('seller::register.id_number') . '/' . trans('seller::register.tax_id'),
        ];
    }
}
